const api = {
    get: url => {
        return new Promise((resolve, reject) => {
            let request = new XMLHttpRequest();
            request.open('get', url);
            request.send();
            request.onreadystatechange = function () {
                if (request.readyState == 4 && request.status == 200) {
                    resolve(JSON.parse(request.response))
                }
            }
        })
    }
}

export default api;